// gui.js
import dat from 'dat.gui';

class GUIController {
  constructor({ camera, ambientLight, directionalLight }) {
    this.gui = new dat.GUI();
    this.initGUI(camera, ambientLight, directionalLight);
  }

  initGUI(camera, ambientLight, directionalLight) {
    // 创建GUI控制项
    const cameraFolder = this.gui.addFolder('Camera');
    cameraFolder.add(camera.position, 'x').min(-10).max(10).name('Position X');
    cameraFolder.add(camera.position, 'y').min(-10).max(10).name('Position Y');
    cameraFolder.add(camera.position, 'z').min(-10).max(10).name('Position Z');

    const ambientLightFolder = this.gui.addFolder('Ambient Light');
    ambientLightFolder.addColor(ambientLight, 'color').name('Color');

    const directionalLightFolder = this.gui.addFolder('Directional Light');
    directionalLightFolder.addColor(directionalLight, 'color').name('Color');
    directionalLightFolder.add(directionalLight.position, 'x').min(-10).max(10).name('Position X');
    directionalLightFolder.add(directionalLight.position, 'y').min(-10).max(10).name('Position Y');
    directionalLightFolder.add(directionalLight.position, 'z').min(-10).max(10).name('Position Z');

    const axesHelp = this.gui.addFolder('Directional Light');
    axesHelp
  }
}

export { GUIController };